<?php
$connect = mysql_connect("localhost","root","");
$selectSQL = mysql_select_db("new");
mysql_query("set names utf8");

$user = $_POST["user"];
$pass = $_POST["pass"];


//查询数据库数据,是否被注册
$sql = "SELECT * FROM WYNews WHERE (Email = '{$user}' OR tele = '{$user}') AND pass = '{$pass}'";
$result = mysql_query($sql);
if(mysql_affected_rows()>0){
	$row = mysql_fetch_assoc($result);
	$headUrl = $row['headImgUrl'];
	$arr = array('msg' => '登录成功','info'=>$user,'headUrl'=>$headUrl,'error'=>0);
	echo json_encode($arr);
	
}else{
		$arr = array('msg' =>'登录失败','error'=>1);
		echo json_encode($arr);	
}

?>